package org.springblade.flow.drawingapproval.controller;

import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.flow.drawingapproval.entity.DrawingApproval;
import org.springblade.flow.drawingapproval.service.IDrawingApprovalService;
import org.springblade.flow.drawingapproval.vo.DrawingApprovalVO;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/process/drawingapproval")
@AllArgsConstructor
public class DrawingApprovalController extends BladeController{

	private IDrawingApprovalService drawingApprovalService;

	@PostMapping("/startDrawingApproval")
	public R startDrawingApproval(@RequestBody DrawingApproval drawingApproval) {
		boolean result = drawingApprovalService.startDrawingApproval(drawingApproval);
		return R.status(result);
	}

	/**
	 * 根据id查询订单详情
	 * @param id
	 * @return
	 */
	@GetMapping("/getDrawingApprovalDetail")
	public R getDrawingApprovalDetail(@RequestParam("id") Long id) {
		DrawingApprovalVO drawingApproval = drawingApprovalService.getDrawingApprovalDetail(id);
		return R.data(drawingApproval);
	}

}
